import React from 'react';
import {
  Form,
  Modal,
  Table,
} from 'antd';


// 查看详情
const RecordModal = Form.create()(props => {
  const { lookRecordView, showRecordModal, pageChange, withdrawList } = props;
  const columns = [
    {
      title: '企业名称',
      dataIndex: 'enterpriseName',
    }, {
      title: '金额',
      dataIndex: 'amount',
    }, {
      title: '提现时间',
      dataIndex: 'createTime',
    }
    , {
      title: '状态',
      dataIndex: 'status',
      render: val => status(val),

    },
  ];
  const status = (val) => {
    if (val === 1) {
      return '成功';
    } else if (val === 2) {
      return '处理中';
    } else {
      return '失败';
    }
  };
  const pagination = {
    current: withdrawList.pageNo,
    pageSize: 10,
    total: withdrawList.total,
  };

  return (
    <Modal
      width={640}
      destroyOnClose
      title="查看提现信息"
      visible={lookRecordView}
      onOk={() => showRecordModal(false)}
      onCancel={() => showRecordModal(false)}>
      <Table columns={columns}
             onChange={(pagination) => {
               console.log(333,pagination);
               pageChange(pagination);
             }} pagination={pagination} dataSource={withdrawList.data}/>
    </Modal>
  );
});

export default RecordModal;
